const state = {
  globalMaskShow:true, //全局遮罩
  isAgentOneself:false, // 是不是代理人本人的订单
  routerViewRefresh:true, //app.vue的router-view刷新开关，解决安卓某些记性不执行window.location.reload()的问题
  customerInfo: {},
  systemFlag:'inner', //路由是外部访问还是内部访问，除了华瑞e家还有云服会访问产品详情进行投保流程，此值默认为inner，目前只有@/filter/outerLogin.js会修改此值为outer，记于2020-06-30，by TgLee
  rrwebIsPlay: null,
  compareRiskInfo:{},// 缓存产品对比的基本信息
  compareEndParams:{}
}

// getters
const getters = {
  getGlobalMaskShow: state => state.globalMaskShow,
  isAgentOneself: state => state.isAgentOneself,
  customerInfo: state => state.customerInfo,
  getSystemFlag:state => state.systemFlag,
  rrwebIsPlay: state => state.rrwebIsPlay,
  compareRiskInfo: state => state.compareRiskInfo
}

// actions
const actions = {
  
}

// mutations
const mutations = {
  GLOBALMASK_OPEN (state) {
    state.globalMaskShow = true
  },
  GLOBALMASK_CLOSE (state) {
    state.globalMaskShow = false
  },
  AGENTONESELF(state, flag){
    state.isAgentOneself = flag
  },
  OPEN_ROUTERVIEW(state){
    state.routerViewRefresh = true
  },
  CLOSE_ROUTERVIEW(state){
    state.routerViewRefresh = false
  },
  saveCustomerInfo(state, obj){
    state.customerInfo = obj
  },
  SAVESYSTEMFLAG(state,data){
    state.systemFlag = data
  },
  OPEN_RRWEBISPLAY(state) {
    state.rrwebIsPlay = true
  },
  CLOSE_RRWEBISPLAY(state) {
    state.rrwebIsPlay = false
  },
  RESET_RRWEBISPLAY(state) {
    state.rrwebIsPlay = null
  },
  saveCompareRiskInfo(state, data){
    state.compareRiskInfo = data
  },
  saveCompareEndParams(state, data){
    state.compareEndParams = data
  },
}

export default {
  state,
  getters,
  actions,
  mutations
}